package com.jokerku.lottery.domain.validate;

import com.jokerku.lottery.application.IWxValidateService;
import com.jokerku.lottery.infrastructure.utils.sdk.SignatureUtil;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;

/**
 * @Author: guzq
 * @CreateTime: 2022/08/30 16:55
 * @Description: 微信验签服务
 * @Version: 1.0
 */
@Service
public class WxValidateServiceImpl implements IWxValidateService {

    @Value("${wx.config.token}")
    private String token;

    @Override
    public boolean checkSign(String signature, String timestamp, String nonce) {
        return SignatureUtil.check(token, signature, timestamp, nonce);
    }
}
